package com.firewolf.springcloud.rules;

import java.util.List;

import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.loadbalancer.Server;

public class MyRule extends com.netflix.loadbalancer.AbstractLoadBalancerRule {

	@Override
	public Server choose(Object key) {
		ILoadBalancer balancer = getLoadBalancer();
		List<Server> allServers = balancer.getAllServers();
		return allServers.get(0);
	}

	@Override
	public void initWithNiwsConfig(IClientConfig arg0) {
	}
}
